package today.rocky.boot.dubbo.controller;

import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import today.rocky.boot.dubbo.service.ProService;

/**
 * @author Rocky
 * @date 2020/2/24 19:02
 */
@RestController
public class ConController {

    @Reference(loadbalance = "roundrobin",
               cluster = "failsafe",
               mock ="today.rocky.boot.dubbo.AlternativeService"
    )
    ProService proService;


    @GetMapping("/hello")
    public String hello(){
        String s = proService.sayHello();
        return s;
    }
}
